![]() |
HCreateResFile |
||||
Header: | Resources.h | Carbon status: | Supported | |
Creates an empty resource fork, when the FSpCreateResFile function is not available.
void HCreateResFile ( SInt16 vRefNum, SInt32 dirID, ConstStr255Param fileName );
The volume reference number of the volume on which the file is located.
The directory ID of the directory where the file is located.
The name of the file whose resource fork is to be created. If no other file with the given name exists in the specified directory, the function creates a resource file—that is, a resource fork, including a resource map. In this case the file has a zero-length data fork.
If a file with the specified name already exists and includes a resource fork with a resource map, the function does nothing. If the data fork of the specified file already exists but the file has a zero-length resource fork, the function creates an empty resource fork and resource map for the file.
Don’t use the resource fork of a file for data that is not in resource format. The Resource Manager assumes that any information in a resource fork can be interpreted according to the standard resource format described in this chapter.
The File Manager assumes that the first block of a file’s resource fork is part of the resource header and puts information there that it uses during scavenging—for example, after the user presses the Reset switch. For this reason, if you copy a resource file, the duplicate may not be exactly like the original.
Before you can work with the newly created file’s resource fork, you must first use the HOpenResFile function or a related function to open it.
To check for errors, call the ResError function.
This function may move or purge memory blocks in the application heap. Your application should not call this function at interrupt time.
Supported in Carbon. Available in Mac OS 8.1 and later when Carbon 1.0.2 or later is present.
© 2000 Apple Computer, Inc. — (Last Updated 5/8/2000)